package com.baidu.service.impl;

import com.baidu.entity.User;
import com.baidu.mapper.UserMapper;
import com.baidu.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @描述
 * @Author UserServiceImpl
 * @Date 2019/4/16 19:22
 **/
@Service("userService")
public class UserServiceImpl implements UserService {
    @Resource
    private UserMapper userMapper;

    /**
     * 根据id查询用户信息
     * @param uid
     * @return
     */
    @Override
    public User selectUserById(Integer uid) {

        return userMapper.selectUserById(uid);
    }

    /**
     * 根据手机号码查询用户
     * @param uphone
     * @return
     */
    @Override
    public User selectUseruphone(String uphone) {
        return userMapper.selectUseruphone(uphone);
    }

    /**
     * 查询所有用户
     * @param
     * @return
     */
    @Override
    public List<User> selectUser() {
        return userMapper.selectUser();
    }

    /**
     * 添加用户
     * @param uphone
     * @return
     */
    @Override
    public Integer registerUser(String uphone) {
        return userMapper.registerUser(uphone);
    }

}
